package cn.zhf.shop.utils;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;

import java.util.Map;

/**
 *
 */
public class HttpChinaPayUtils {

    /**
     * @Author: Wz
     * @param url
     * @param param
     * @return
     * @Description: 表单形式发送POST请求
     */
    public static HttpResponse doPost(String url, Map param){

        HttpResponse res = HttpRequest.post(url).header("Accept","application/json;charset=UTF-8").form(param).timeout(30000).execute();

        return res;
    }

    /**
     * @Author: Wz
     * @param url
     * @param param
     * @return
     * @Description: 表单形式发送GET请求
     */
    public static HttpResponse doGet(String url, Map param){

        HttpResponse res = HttpRequest.get(url).header("Accept","application/json;charset=UTF-8").form(param).timeout(30000).execute();

        return res;
    }

}
